#ifndef CUSTOMERSPARSER_H
#define CUSTOMERSPARSER_H

#include "Customer.h"
#include "CustomersModel.h"

#include <vector>
#include <QTextStream>
#include <QFile>

namespace ecocity
{

class CustomerParser
{

public:

    static bool parse( const QString& file_customers_csv,
                       std::vector< Customer >& customers );

    static std::vector< int > separators_in_line( const QString& line,
                                                  const char separator = ';' );

    static Customer to_customer( const QString& line, const char separator = ';' );

private:

    static void parse_line( const QString& line,
                            std::vector< Customer >& customers,
                            const char separator = ';' );

    static bool parse_file( QFile& stream,
                            std::vector< Customer >& customers,
                            const char separator = ';' );
};

}      // namespace liga


#endif // CUSTOMERSPARSER_H
